In oil exploration and production, it is advantageous to sample hydrocarbons in a formation to determine the physical and chemical properties of the fluid in the formation during drilling of a borehole. Identifying these properties is important for characterizing a formation and its fluid(s), determining production methods, and designing well completions and topside facilities. To perform testing, drilling equipment may be removed and a downhole tool may be deployed into the borehole to test and/or sample one or more formation fluids at various stations or positions of the tool. Typically, the tested fluids contain impurities or contaminants such as, for example, drilling fluids, cuttings, mud, or different subterranean fluids. During sampling and measuring, impurities or contaminant may tend to adhere to sensor interfaces with the sampled fluid and form a film coating. This coating can significantly alter the measured characteristics of the fluid sample. It is highly desirable to ensure that these impurities are detected, because even small amounts of contaminant may cause an analysis to mischaracterize the sample.